package com.frxuexi.lib_base

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController

@Composable
fun MyTitleBar(title:String,navHostController: NavHostController) {
    Box( modifier = Modifier.padding(10.dp)) {
        Icon(imageVector = Icons.Default.ArrowBack, contentDescription = "",
            Modifier.clickable { navHostController.popBackStack() })
        Text(text = title, textAlign = TextAlign.Center, modifier = Modifier.fillMaxWidth())
    }
}